-
Notifications
You must be signed in to change notification settings - Fork 32
♻️🐛Refactors webserver's errors middleware to handle LineTooLong exceptions
#7878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️🐛Refactors webserver's errors middleware to handle LineTooLong exceptions
#7878
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7878 +/- ##
==========================================
- Coverage 87.98% 87.46% -0.52%
==========================================
Files 1844 1394 -450
Lines 71034 57208 -13826
Branches 1219 619 -600
==========================================
- Hits 62499 50039 -12460
+ Misses 8187 6960 -1227
+ Partials 348 209 -139
*This pull request uses carry forward flags. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the error middleware to address the LineTooLong error and improves the error handling pipeline for HTTP exceptions. Key changes include:
- Refactored error middleware logic with dedicated handlers for various HTTP exceptions.
- Enhanced HTTP error formation with proper envelope wrapping and logging.
- Added tests to verify the handling of NotImplementedError, TimeoutError, and unexpected exceptions.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/service-library/tests/aiohttp/test_rest_middlewares.py | Introduced new tests to verify correct error mapping and envelope wrapping. |
| packages/service-library/src/servicelib/aiohttp/rest_responses.py | Updated HTTP error creation logic with refined message handling. |
| packages/service-library/src/servicelib/aiohttp/rest_middlewares.py | Refactored error handling functions and middleware to improve robustness and clarity. |
Comments suppressed due to low confidence (1)
packages/service-library/src/servicelib/aiohttp/rest_middlewares.py:129
- The function uses 'json_loads' without an explicit import. Consider importing it or using the appropriate function from the common library to ensure consistency.
payload = json_loads(exception.text)
LineTooLong exceptions
|
@mergify queue |
🛑 The pull request has been removed from the queue
|
matusdrobuliak66
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
a9a62dd to
30ea3fe
Compare
|
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:You may have to fix your CI before adding the pull request to the queue again. |
|



What do these changes do?
In master deploy we still notice LineTooLong error but the issue cannot be really traced in our code base.
In this PR we implement a long expected refactoring of the errors middleware. The new design:
LineTooLongerror that motivated this PR)Related issue/s
How to test
Dev-ops
None